package org.example.demo.view.form;

import de.saxsys.mvvmfx.FxmlView;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import org.example.demo.bundle.I18N;
import org.example.demo.bundle.I18NBinder;
import org.example.demo.bundle.ResourceManager;

import java.net.URL;
import java.util.Locale;
import java.util.ResourceBundle;


public class FormValidateView implements FxmlView<FormValidateViewModel>, Initializable {

    public TipVBox activityName;
    public TipHBox activityZone;
    @I18N("button.save")
    public Button saveBtn;
    @I18N("button.reset")
    public Button resetBtn;

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        I18NBinder.bind(this);
    }

    @FXML
    private void onSaveButtonClick() {
        activityName.showTip("请输入活动名称");
        activityZone.showTip("请输入活动区域");
    }

    @FXML
    private void onResetButtonClick() {
        ResourceManager.getInstance().setLocale(Locale.CHINA);
        activityName.hideTip();
        activityZone.hideTip();
    }


}
